package com.ecoolex.discount.sales.core.manager;

import com.ecoolex.discount.sales.core.dao.YWBrandCateDAO;
import com.ecoolex.discount.sales.entity.YWBrandCate;
import com.ecoolex.discount.sales.entity.YWBrandCateExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YWBrandCateManager {
    @Autowired
    private YWBrandCateDAO dao;

    public List<YWBrandCate> getCateByBrandId(String brandId){
        YWBrandCateExample.Criteria criteria = YWBrandCateExample.newAndCreateCriteria()
                .andBrandIdEqualTo(brandId)
                .andStatusEqualTo(1)
                .andDeletedEqualTo(YWBrandCate.NOT_DELETED);
        return dao.selectByExample(criteria.example());
    }
}
